package com.xinsilu.hospital.controller;


import com.xinsilu.common.Result;
import com.xinsilu.hospital.entity.UserTable;
import com.xinsilu.hospital.service.IUserTableService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author ym
 * @since 2021-09-22
 */
@RestController
@RequestMapping("/api/hospital/userTable")
public class UserTableController {

    @Autowired
    private IUserTableService iUserTableService;

    @RequestMapping("/insertuser")
    public Object addgh(UserTable userTable){
        System.out.println("实体类获取数据展示:"+userTable);
        boolean save = iUserTableService.save(userTable);
        if(save){
            return Result.ok("成功");
        }
        return Result.ok(save);

    }

    @RequestMapping("/brsuo")
    public Object sousuo() {
        List<UserTable> list = iUserTableService.list();
        return Result.ok(list);

    }
}
